Wanderings

Azure Tinkering

Create an Azure Container Registry (ACR) that resolves to a custom private DNS zone:

  1. Create a Resource Group (if you don't have one already):

    az group create --name myResourceGroup --location eastus
  2. Create an Azure Container Registry:

    az acr create --resource-group myResourceGroup --name myRegistry --sku Standard
  3. Create a Virtual Network (if you don't have one already):

    az network vnet create
       --resource-group myResourceGroup
       --name myVnet 
       --address-prefix 10.0.0.0/8 
       --subnet-name mySubnet 
       --subnet-prefix 10.0.0.0/24
  4. Create a Private DNS Zone:

    az network private-dns zone create
       --resource-group myResourceGroup
       --name myprivatednszone.com
  5. Link the Virtual Network to the Private DNS Zone:

    az network private-dns link vnet create
       --resource-group myResourceGroup
       --zone-name myprivatednszone.com
       --name myLink
       --virtual-network myVnet
       --registration-enabled false
  6. Enable Private Endpoint on the Container Registry:

    az network private-endpoint create
       --resource-group myResourceGroup
       --vnet-name myVnet
       --subnet mySubnet
       --name myPrivateEndpoint
       --private-connection-resource-id $(az acr show --name myRegistry --query 'id' -o tsv)
       --group-id registry
       --connection-name myConnection
  7. Configure Private DNS Zone to Resolve the Container Registry's Private Link:
    Get the necessary DNS records for the registry:

    az acr show -n myRegistry --query 'networkRuleSet.defaultAction' -o table

    Look for the Fully Qualified Domain Name (FQDN) of the registry and create DNS records using:

    az network private-dns record-set a create -g myResourceGroup
       --zone-name myprivatednszone.com --name myRegistry-privatelink 
    
    az network private-dns record-set a add-record
       -g myResourceGroup --zone-name myprivatednszone.com
       --record-set-name myRegistry-privatelink
       --ipv4-address <Private IP Address of the Endpoint>

Table of Contents


Updated on August 7, 2025